package cn.wegoteam.shop.util;

//import java.io.BufferedReader;
//import java.io.InputStreamReader;
//import java.io.UnsupportedEncodingException;
//import java.net.HttpURLConnection;
//import java.net.URL;
//import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import cn.wegoteam.shop.cache.Cache;

public class Phone {
	public static boolean isMobileNO(String mobiles) {
		Pattern p = Pattern
				.compile("^((13[0-9])|(15[0-3,5-9])|(17[0,6-8])|(18[0-9]))\\d{8}$");
		Matcher m = p.matcher(mobiles);
		return m.matches();
	}
	//云通讯、云之讯发送验证码
	public static String sendRandom(Map<String,String> params) throws Exception{
		params.put("SERVICE_PWD",Cache.getSetting(Const.SERVICE_PWD).getValue());
		String result = PostAndGetRequset.post(Cache.getSetting(Const.SERVICE_URL).getValue()+Cache.getSetting(Const.SMS).getValue(), params);
		System.out.println("返回的结果为---------"+result);
		return result;
	}
}
